package com.urick.spi.dubbo.ext.inject;

import cn.hutool.log.Log;
import cn.hutool.log.LogFactory;
import com.urick.spi.dubbo.common.URL;
import com.urick.spi.dubbo.ext.IAdaptiveExt;
import com.urick.spi.dubbo.ext.IExt;
import com.urick.spi.dubbo.ext.IExtResult;
import com.urick.spi.dubbo.ext.IInjectExt;
import com.urick.spi.dubbo.ext.base.DefBaseExt;

/**
 * Design Theories:
 * <a href=""></a>
 *
 * @author uRick 2021/12/13 12:37
 * Email: rickwork@163.com
 * Wechat: yy3076815642
 * QQ: 3076815642
 * @since 1.0
 */
public class InjectExt implements IInjectExt {
    private final static Log logger = LogFactory.get();
    private IAdaptiveExt adaptiveExt;

    public void setAdaptiveExt(IAdaptiveExt adaptiveExt) {
        this.adaptiveExt = adaptiveExt;
    }

    @Override
    public IExtResult exe() {
        IExtResult result = adaptiveExt.exe(URL.valueOf("test://localhost?IAdaptiveExt_Value=adaptive1"));
        logger.info("{}-{}", this.getClass().getSimpleName(), result);
        return result;
    }
}
